package com.biz.primus.ms.promotion.dao.ro;

import com.biz.primus.base.redis.annotation.Ro;
import com.biz.primus.base.redis.annotation.RoSortedSet;
import com.biz.primus.base.redis.bean.BaseRedisObject;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 预售商品 ID: 预售活动ID + 商品ID
 *
 * @author david-liu
 */
@Getter
@Setter
@Ro(key = "fmt:presell:product")
@RoSortedSet(key = "list", score = "createTimestamp")
public class PresellProductRo extends BaseRedisObject<String> {
    private static final long serialVersionUID = -8309515211492978566L;

    /**
     * 预售活动ID
     */
    private Long presellPromotionId;

    /**
     * 参与预售活动的ID
     */
    private Long productId;

    /**
     * 预售商品总量
     */
    private Integer presellQuantity;

    /**
     * 预售商品剩余数量
     */
    private Integer remainQuantity;

    /**
     * 限购数量
     */
    private Integer purchaseLimit;

    /**
     * 预售价
     */
    private Integer presellPrice;

    /**
     * 订购该预售商品的总人数
     */
    private Integer participateMemberCount;

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}
